<template>
	<scroll-view style="height: 100vh;" scroll-y="true">
		<view class="lists" v-for="(item,index) in listdata" :key="index">
			<view class="items">
				<view class="type-title">{{item.body}}</view>
				<view class="type-golds">{{item.num>0?'+'+item.num:item.num}}</view>
			</view>
			<view class="items margintype" >
				<view>{{item.add_time}}</view>
				<view>余额：{{item.integral}} 币</view>
			</view>
		
		</view>
	</scroll-view>
</template>

<script>
	/**
	 * 金币来源记录
	 */
	export default{
		data(){
			return{
				listdata:'',
			}
		},
		onLoad(){
			this.getlist();
		},
		methods:{
			
			//获取金币来源记录
			getlist(){
				this.$HttRequest({
					url: '/member/integralList',
					param:''
				}).then((res) => {
					console.log(res);
					if (res.status === 10000) {
						this.listdata = res.data.data;
					} else {
						this.$ShowMsg(res.message)
					}
				}).catch((error) => {
					//异常错误
					this.$ShowMsg('statusCode：' + error.errMsg);
				});
			}
		}
	}
</script>

<style lang="scss">
	
	.lists{
		width: 90%;
		display: flex;
		justify-content: center;
		flex-direction: column;
	
		border-bottom:1rpx solid #eaeaea;
		margin: 30rpx;
	
		color: #c1c1c1;
		font-size: 22rpx;
		padding-bottom: 20rpx;
		.margintype{
			margin-top: 10rpx;
		}
		.items{
			
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.type-title{
				color: #000; 
				font-size: 30rpx;
			}
			.type-golds{
				font-weight: bold;
				color: #e9564f;
				font-size: 30rpx;
			}
			}
		}
</style>
